public class E2 {
    public static void main(String args[]){
        String s="ABCDacbd";
        char cStart=s.charAt(0);
        char cEnd=s.charAt(s.length()-1);
        System.out.println(cStart);
        System.out.println(cEnd);
    }
}
